import request from '@/utils/request'
import qs from "qs"

export default{


    // 获取数据列表（带筛选和排序）

    getList(pageNum, pageSize,name,position,endTimeType,sort){

        return request({
            url:'/api-operate/ad/getList',
            method:"get",
            params:{pageNum,pageSize,name,position,endTimeType,sort}


        }) 

    },

    // 根据id查询广告

    selectOne(id){
        return request({
            url:'/api-operate/ad/selectOne',
            method:"get",
            params:{id}


        }) 


    },


 //修改广告

 updateList(ad){

    var data=qs.stringify(ad);

    return request({
        url:'/api-operate/ad/updateList',
        method:"post",
        data


    })
},

    // 添加广告

    addList(ad){

        var data=qs.stringify(ad);

        return request({
            url:'/api-operate/ad/addList',
            method:"post",
            data


        })
    },


     // 删除单条数据(物理删除)

     deleteOne(id){

       

        return request({
            url:`/api-operate/ad/deleteOne/${id}`,
            method:"delete",
          


        })
    }

}